package com.training.content.service.impl;

import java.util.List;
import com.training.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.training.content.mapper.CheckRecordMapper;
import com.training.content.domain.CheckRecord;
import com.training.content.service.ICheckRecordService;

/**
 * 审核记录Service业务层处理
 * 
 * @author training
 * @date 2021-10-25
 */
@Service
public class CheckRecordServiceImpl implements ICheckRecordService 
{
    @Autowired
    private CheckRecordMapper checkRecordMapper;

    /**
     * 查询审核记录
     * 
     * @param checkId 审核记录主键
     * @return 审核记录
     */
    @Override
    public CheckRecord selectCheckRecordByCheckId(Long checkId)
    {
        return checkRecordMapper.selectCheckRecordByCheckId(checkId);
    }

    /**
     * 查询审核记录列表
     * 
     * @param checkRecord 审核记录
     * @return 审核记录
     */
    @Override
    public List<CheckRecord> selectCheckRecordList(CheckRecord checkRecord)
    {
        return checkRecordMapper.selectCheckRecordList(checkRecord);
    }

    /**
     * 新增审核记录
     * 
     * @param checkRecord 审核记录
     * @return 结果
     */
    @Override
    public int insertCheckRecord(CheckRecord checkRecord)
    {
        checkRecord.setCreateTime(DateUtils.getNowDate());
        return checkRecordMapper.insertCheckRecord(checkRecord);
    }

    /**
     * 修改审核记录
     * 
     * @param checkRecord 审核记录
     * @return 结果
     */
    @Override
    public int updateCheckRecord(CheckRecord checkRecord)
    {
        checkRecord.setUpdateTime(DateUtils.getNowDate());
        return checkRecordMapper.updateCheckRecord(checkRecord);
    }

    /**
     * 批量删除审核记录
     * 
     * @param checkIds 需要删除的审核记录主键
     * @return 结果
     */
    @Override
    public int deleteCheckRecordByCheckIds(Long[] checkIds)
    {
        return checkRecordMapper.deleteCheckRecordByCheckIds(checkIds);
    }

    /**
     * 删除审核记录信息
     * 
     * @param checkId 审核记录主键
     * @return 结果
     */
    @Override
    public int deleteCheckRecordByCheckId(Long checkId)
    {
        return checkRecordMapper.deleteCheckRecordByCheckId(checkId);
    }
}
